//
//  CPSCGoodsDetailsUIHelper.m
//  CPSCustomer
//
//  Created by codew on 7/28/21.
//  Copyright © 2021 dgg_hzk. All rights reserved.
//

#import "CPSCGoodsDetailsUIHelper.h"




@implementation CPSCGoodsDetailsUIHelper


/** 资产/服务详情__左 */
+ (CGFloat)marginLeft
{
    return 10;
}

/** 资产/服务详情__上下间距 */
+ (CGFloat)marginTopBottom
{
    return 12;;
}

/** 资产/服务详情__底部规划师信息view高度 */
+ (CGFloat)heightUserInfoBottomTools
{
    
    if (@available(iOS 11.0, *)) {
        if (UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom > 0.0){
            
            return 92;
        }else {
            
            return 72;
        }
    } else {
        return 72;
    }

}


+ (CGFloat)heightCommonHeader
{
    return 54;
}

/**  相关推荐 最底部那个 cell的高 */
+ (CGFloat)heightRecommendGoodsCell
{
    return 138;
}

/** 锚点view的高度 */
+ (CGFloat)heightViewPositionSpuer
{
    return 44;
}

/** 包含服务 */
+ (CGFloat)heightCellService
{
    return 70;
}
/** 包含项目 */
+ (CGFloat)heightCellProject
{
    return 44;
}


/** 推荐规划师提问View高 */
+ (CGFloat)heightAskViewPlanner
{
    return 120;
}
/** 推荐规划师每个Cell高 */
+ (CGFloat)heightCellPlanner
{
    return 70;
}
/** 推荐规划师最多显示多少条 */
+ (CGFloat)countShowPlanner
{
    return 3;
}
/** 推荐规划师 View高度, 等级数据来 */
+ (CGFloat)heightPlannerViewWithArray:(NSArray *)array
{
    // 隐藏
    if (array.count == 0) {
        return 0;
    }
    
    
    CGFloat height = 0;
    
    NSInteger count = array.count > CPSCGoodsDetailsUIHelper.countShowPlanner ? CPSCGoodsDetailsUIHelper.countShowPlanner : array.count;
    
    CGFloat heightAllCell = count * CPSCGoodsDetailsUIHelper.heightCellPlanner;
    
    height += heightAllCell;
    
    height += CPSCGoodsDetailsUIHelper.heightCommonHeader;
    
    height += CPSCGoodsDetailsUIHelper.heightAskViewPlanner;
    
    return height;
}
@end
